package Dao;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

import entity.Word;
import util.Dbconnect;

/**
 * @author 张文涛
 *
 */
public interface WordDao {
	
	/**
	* Title: searchByname
	* Description: 通过英文搜索单词
	* @author 张文涛
	 */
	public List<Word> searchByname(String word,Integer limit) throws Exception ;
	
	/**
	 * Title: getWords
	 * Description: 从 Book 中 的 begin 开始 获取 limit 条数的 单词列表
	 * @author 张文涛
	 * @throws Exception 
	 */
	public List<Word> getWords(String book,Integer begin,Integer limit) throws Exception;
	
	/**
	 * Title: searchByChinese
	 * Description: 通过单词中文匹配所有单词
	 * @author 张文涛
	 */
	public List<Word> searchByChinese(String chinese,Integer limit) throws Exception;
	
	/**
	 * Title: getBooks
	 * Description: 获取图书列表
	 * @author 张文涛
	 * @throws Exception 
	 */
	public List<String> getBooks() throws Exception;
	
	/**
	 * Title: searchByname
	 * Description: 在某本书中通过单词名搜索该单词
	 * @author 张文涛
	 */
	public List<Word> searchByname(String book,String word,Integer limit) throws Exception;
	
	/**
	 * Title: searchByChinese
	 * Description: 在某本书中通过中文搜索该单词
	 * @author 张文涛
	 */
	public List<Word> searchByChinese(String book,String chinese,Integer limit) throws Exception;
	
	/**
	 * Title: getNonMemaryWordList
	 * Description: 获取未背过单词列表
	 * @author 张文涛
	 * @param book
	 * @param email
	 * @param limit
	 * @return
	 * @throws Exception
	 */
	List<Word> getNonMemaryWordList(String book,String email, Integer limit) throws Exception;
	
	
	/**
	 * Title: getNonMemaryWordList
	 * Description: 获取已背过单词列表
	 * @author 张文涛
	 * @param book
	 * @param email
	 * @param limit
	 * @return
	 * @throws Exception
	 */
	List<Word> getMemaryWordList(String book,String email, Integer limit) throws Exception;
	
	/**
	 * Title: updateid
	 * Description: 从总表中更新子表 wordid
	 * @author 张文涛
	 * @throws Exception
	 */
	public void updateid() throws Exception;
	
	/**
	 * Title: getOrderNoMemaryWordList
	 * Description: 字典序获取未背过单词列表
	 * @author 张文涛
	 * @param book
	 * @param email
	 * @param limit
	 * @return
	 * @throws Exception
	 */
	public List<Word> getOrderNoMemaryWordList(String book,String email, Integer limit) throws Exception;


	/**
	 * Title: getOrderMemaryWordList
	 * Description: 字典序获取已背过单词列表
	 * @author 张文涛
	 * @param book
	 * @param email
	 * @param limit
	 * @return
	 * @throws Exception
	 */
	public List<Word> getOrderMemaryWordList(String book, String email, Integer limit) throws Exception;

	/**
	 * Title: insertword
	 * Description: 添加单词
	 * @author 张文涛
	 * @param w
	 * @throws Exception
	 */
	public void addword(String book,Word w) throws Exception;
	
	/**
	 * Title: getbyid
	 * Description: 通过id 获取单词
	 * @author 张文涛
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Word getbyid(Integer id) throws Exception;
	
}
